package com.zbkj.crmeb.enums;

import com.baomidou.mybatisplus.core.enums.IEnum;
import com.fasterxml.jackson.annotation.JsonCreator;
import com.fasterxml.jackson.annotation.JsonValue;

/**
 * 首页样式
 * @Description: 
 * @author daigb
 * @date 2021-09-25
 */
public enum HomeStyleEnum implements IEnum<Integer> {
    /**
     * 类型
     */
    SLIDE_SHOW(1, "轮播区"),
    HOT_SHOW(2, "热区"),
    PREFECTURE_SHOW(3, "专区"),
    BRAND_SHOW(4, "品牌"),
    PRODUCT_SHOW(5, "商品列表"),
    HOME_VIDEO(6, "首页视频"),
    LIMITED_TIME_EVENT(7, "限时活动"),
    TITLE_SHOW(8, "标题文本"),
    IMAGE_TEXT_SHOW(9, "图文导航"),
    INTEGRAL_STORE(10, "积分商城"),
    PACKAGE_DISCOUNT(11, "优惠套餐")
    ;

    private final Integer code;
    private final String msg;

    HomeStyleEnum(int code, String msg) {
        this.code = code;
        this.msg = msg;
    }

    public Integer getCode() {
        return code;
    }

    public String getMsg() {
        return msg;
    }

    @JsonCreator
    public static HomeStyleEnum valueOf(Integer code) {
        for (HomeStyleEnum value : values()) {
            if (code.equals(value.getCode())) {
                return value;
            }
        }
        return HomeStyleEnum.SLIDE_SHOW;
    }

    @Override
    @JsonValue
    public Integer getValue() {
        return code;
    }

}

